package group2assignone.ucm.administrator;

import group2assignone.model.Manager;
import group2assignone.ucm.UCController;
import group2assignone.view.administrator.EditManagerView;

/**
 * Use Case: Change UI to  Use case Main Administrator View                 <br>
 * Pre-condition: User has clicked cancel from the Edit Manager view.        <br>
 * Post-condition: Administrator main UI Use Case is run                    <br>
 * 1. system closes the  Edit Manager view                                   <br>
 * 2. system runs the use case UI Admin Main View                           <br>
 * @author group2                                                           <br>
 */
public class UCCancelEditManager implements UCController {

    private Manager model;
    private EditManagerView view;

    public UCCancelEditManager(Manager m, EditManagerView v) {
        model = m;
        view = v;
    }

    public void run() {
        //1. system closes the  Edit Manager view
        view.dispose();
        //2. system runs the use case UI Admin Main View
        UCUIAdminMainView uc = UCUIAdminMainView.getInstance();
        uc.run();
    }
}
